#!/bin/sh

sudo busybox httpd -f -vvv -c ./httpd.conf &

echo 32.3 > /tmp/mcu-goal.txt
echo 87.5 > /tmp/mcu-humi.txt
echo '[{"ssid": "charlene", "encrypt": "none", "level": "94"}, {"ssid": "gillian", "encrypt": "wep", "level": "55"}, {"ssid": "twins", "encrypt": "wpa", "level": "25"}]' > /tmp/wifi-list.txt
echo gillian  > /tmp/wifi-connected.txt

echo '[{"cron": "2 3 * * 1-5", "action": "on"}, {"cron": "3 4 2 6 *", "action": "off"}, {"cron": "4 5 * * 5,6", "action": "on"}]' > /tmp/crontab

while true; do
  echo 2$(($RANDOM % 5)).$(($RANDOM % 90)) > /tmp/mcu-temp.txt.new
  mv /tmp/mcu-temp.txt.new /tmp/mcu-temp.txt
  sleep 3
done &
